<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统- 后台管理</title>
<link href="<%=basePath%>/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>/js/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript">
function add(){
	parent.openWin("<%=basePath%>/goToEditProvider.do",600,300,'添加服务商','服务商信息','二维码服务商信息编辑');
}
function edit(providerId){
	parent.openWin("<%=basePath%>/goToEditProvider.do?provider.providerId="+providerId,600,300,'编辑服务商','服务商信息','二维码服务商信息编辑');
}
function goToPage(curPage){
	$("#queryPageCurPage").val(curPage);
	$("#providerQueryForm").submit();
}

</script>

</head>
<body>
<table width="100%" border="0" cellspacing="6" cellpadding="0" style="border-collapse: separate; border-spacing: 6px;">
	<tr valign="top">
		<td>
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				class="blockTable">
				<tr>
					<td style="padding:2px 10px;">
					<form id="providerQueryForm"  name="providerQueryForm" action="${pageContext.request.contextPath}/providerList.do" method="post" target="consoleFrame" >
						<input name="queryPage.curPage" id="queryPageCurPage" type="hidden" value="${queryPage.curPage}"/>
							<div style="float: left;">
							服务商名称: <input name="provider.name" type="text" value="${provider.name}" id="Keyword"/> 
								<input id="Submitbutton" type="submit" value="查询" />
							</div>
							<div style="float: right;">
								<a href='javascript:void(0);' ztype='zPushBtn' class='zPushBtn' hidefocus='true' tabindex='-1' onselectstart='return false' id='BtnAdd' onClick="add();return false;" priv="article_modify">
									 <img src="<%=basePath%>/images/icons/icon003a2.gif" width="20" height="20"/><b>新建&nbsp;</b>
								 </a>
							</div>
						</form>
					 </td>
				</tr>
				<tr>
					<td style="padding-top:2px;padding-left:6px;padding-right:6px;padding-bottom:2px;">
						<table width="100%" cellpadding="2" cellspacing="0" class="dataTable">
							<tr ztype="head" class="dataTableHead">
								<td width="7%"><strong>服务商编号</strong></td>
								<td width="7%"><strong>服务商名称</strong></td>
								<td width="20%"><strong>处理器</strong></td>
								<td width="7%"><strong>申请码方式</strong></td>
								<td width="7%"><strong>发送短信</strong></td>
								<td width="7%"><strong>创建时间</strong></td>
								<td width="15%"><strong>操作</strong></td>
							</tr>
							<c:forEach items="${providerList}" var="p">
								<tr>
									<td>${p.providerId}</td>
									<td>${p.name}</td>
									<td>${p.processor}</td>
									<td>${p.separateCn}</td>
									<td>${p.sendSmsCn}</td>
									<td><fmt:formatDate value="${p.createTime}" type="both" pattern="yyyy-MM-dd" /></td>
									<td>
										<a href='javascript:void(0);' onClick="edit(${p.providerId});return false;" >编辑</a>
										<a href='<%=basePath%>/providerDel.do?provider.providerId=${p.providerId}' target="consoleFrame" >删除</a>
									</td>
								</tr>			
							</c:forEach>
							<tr ztype="pagebar">
							<td colspan="7" align="left">
								<div style='float:right;font-family:Tahoma'>
									<a href="javascript:goToPage('1');">第一页</a>
										&nbsp;
									<c:if test="${((queryPage.curPage) > 1)}">
									|&nbsp;<a href="javascript:goToPage('${(queryPage.curPage-1)}');">上一页</a>
									&nbsp;|
									</c:if>&nbsp;
									<c:if test="${queryPage.curPage< queryPage.pageCount}">
										<a href="javascript:goToPage('${(queryPage.curPage+1)}');">下一页</a>&nbsp;|&nbsp;<a href="javascript:goToPage('${(queryPage.pageCount)}');">最末页</a>
									</c:if>
									&nbsp;&nbsp;
									转到第&nbsp;<input id="gotopage" type='text' class='inputText' style='width:40px' onKeyUp="value=value.replace(/\D/g,'')">&nbsp;页&nbsp;&nbsp;<input type='button' onclick="if(!/^\d+$/.test($('#gotopage').val())){alert('错误的页码');$('#gotopage').focus();}else{goToPage($('#gotopage').val());}" class='inputButton' value='跳转'>
								</div>
								<div style='float:left;font-family:Tahoma'>共 ${(queryPage.totalItem)} 条记录，每页  ${(queryPage.pageSize)} 条，当前第  ${(queryPage.curPage)} / ${(queryPage.pageCount)} 页</div>
							</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>
